home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wlib11_4.zip / HEADERS.EXE / WSTRUCT.H < prev   
Text File  |  1991-02-27  |  5KB  |  131 lines

  1. /*** WSTRUCT.H ***/
  2. /* Written By P.A. McKenzie
  3.  * The C Window Library
  4.  * Copyright (C) 1990   All Rights Reserved
  5. */
  6. /* Note:  scroll bars on viewports will be supported in a future version */
  7.  
  8. #ifndef WINSTRUCT_DEF
  9.  
  10. #define WINSTRUCT_DEF
  11.  
  12. #define MAXVBUFSIZE  0xFFFFUL
  13.  
  14. #if defined (LPOWERC)
  15.   typedef  char far *  WBUFPTR;
  16. #else
  17.   typedef  char *      WBUFPTR;
  18. #endif
  19.  
  20. #ifndef NUMBOXCHARS
  21. #define NUMBOXCHARS  8
  22. #endif
  23. #ifndef MAXSCROLLSTRING
  24. #define MAXSCROLLSTRING 6
  25. #endif
  26.  
  27.  typedef struct v_win_status
  28.  {
  29.    unsigned viewport_flag:1;     /* tells if virtual window has a viewport */
  30.    unsigned vwtype:1;            /* tells what type of virtual window */
  31.    unsigned wrap_flag:1;
  32.    unsigned big_vw:1;
  33.  }  V_WIN_STAT;
  34.  
  35.  
  36.  typedef struct virtual_window
  37.  {
  38.      unsigned nbufs;                         /* number of 64K buffers required */
  39.    unsigned char far * far *text;          /* pointer to huge text */
  40.    unsigned char far * far *attr;          /* pointer to attributes */
  41.    unsigned  nrows;                        /* number of rows in window */
  42.    unsigned  ncols;                        /* number of columns in window */
  43.    unsigned row;                           /* row of logical cursor */
  44.    unsigned col;                           /* col of logical cursor */
  45.    int wnum;                               /* virtual window number */
  46.    int num_windows;                     /* pointer to list of windows */
  47.    V_WIN_STAT stat_info;
  48.  }  VWINDOW, *VWPOINTER;
  49.  
  50.  
  51.  
  52.  
  53.  /****************************
  54.  * Define window status bits *
  55.  ****************************/
  56.  
  57. typedef struct win_status
  58. {
  59.   unsigned border_flag:1;       /* Window border flag */
  60.   unsigned wrap_flag:1;         /* Window wrap flag */
  61.   unsigned open_flag:1;         /* window open flag */
  62.   unsigned init_flag:1;         /* window initialized flag */
  63.   unsigned visible_flag:1;      /* window visible flag */
  64.   unsigned v_window_flag:1;     /* window is a viewport flag */
  65.   unsigned bufptr_flag:1;       /* tells if memory allocated for window buffer
  66.                                  * pointer   */
  67.   unsigned sync_curs:1;         /* tells if cursor is to be moved */
  68.   unsigned frozen_flag:1;       /* tells if virtual window is frozen */
  69.   unsigned seethru_flag:1;      /* tells if window is a see thru window */
  70.   unsigned move_flag:1;         /* used internally for window update routines */
  71.   /*unsigned scroll_bars_on:1;  */  /* tells if scroll bars are on */
  72. } WIN_STAT;
  73.  
  74. typedef struct
  75. {
  76.   unsigned shadow_flag:1;       /* tells if there is a shadow */
  77.   unsigned shadow_pos:3;        /* tells where shadow is */
  78.   unsigned shadow_trans:1;      /* tells if shadow is transparent */
  79. } SHADOW_STAT;
  80.  
  81.  
  82. typedef struct
  83. {
  84.    int schar;                     /* shadow character */
  85.    int sattr;                     /* shadow attribute */
  86.    int swidth;
  87.    int sheight;
  88.    SHADOW_STAT shadow_stat;
  89. } WIN_SHADOW;
  90.  
  91.  
  92. typedef struct
  93. {
  94.   char scroll_string[MAXSCROLLSTRING];
  95.   int hilite_attr;
  96.   int norm_attr;
  97. } SCROLL_BAR_INFO;
  98.  
  99.  /**************************
  100.  * Define window structure *
  101.  **************************/
  102.  
  103.  typedef struct window
  104.  {
  105.    VWPOINTER vwptr;                 /* pointer to virtual window */
  106.    unsigned int vwrow;              /* virtual window row */
  107.    unsigned int vwcol;              /* virtual window column */
  108.    int origx;                       /* original x-position */
  109.    int origy;                       /* original y-position */
  110.    int col;                         /* window column */
  111.    int row;                         /* window row  */
  112.    int width;                       /* window width */
  113.    int height;                      /* window height */
  114.    int xpos;                        /* current window x position */
  115.    int ypos;                        /* current window y position */
  116.    int wnum;                        /* Window number */
  117.    int rank;                        /* Where window is in list of windows */
  118.    int pagenum;                     /* video page where window is opened */
  119.    int cursorshape;                 /* tells the cursor shape */
  120.    int battr;                       /* border attribute */
  121.    int wattr;                       /* window attribute */
  122.    char boxchars[NUMBOXCHARS];      /* box characters */
  123.    WBUFPTR textbuf;                 /* points to text plane */
  124.    WIN_STAT stat_info;              /* window status flags */
  125.    WIN_SHADOW shadow_info;          /* shadow status */
  126. /*   SCROLL_BAR_INFO scroll_bar_info;  scroll bar information */
  127.  } WINDOW, *WPOINTER;
  128.  
  129. #include  "vidsys.h"
  130. #endif
  131.